import sys

# str = sys.stdin.readline()
# print(str)
#
# num = input("请输入第一个数字：")
# print(num)
#
# sys.stdout.write('hello')
# print('word')

# file = open('a.txt','r',buffering=1)
# # read 获取所有内容
# print(file.read())
# file.close()

# # with 自动关闭
# with open('a.txt','r',encoding='utf-8',buffering=1) as file2:
#     # # \n 换行符
#     # print(file2.readline())
#     # print(file2.readline())
#     # 一次性读取多行
#     print(file2.readlines())  # 返回一个list
#     # list[] turple() set{1,2,3} dict{}

# with open('a.txt','w',encoding='utf-8',buffering=1) as file3:
#     file3.write('hello world') # 写入 原先会被覆盖掉

# a代表追加写入
with open('a.txt','a',encoding='utf-8',buffering=1) as file4:
    file4.write('hello world111')